import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const store = new Vuex.Store({
  state: {
    check: false,
    expend: false,
    qiankunLoading: true,
    serviceList: [
      {
        name: 'vue2子应用',
        serviceName: 'micro-son',
        serviceEntry: '//localhost:8081',
        path: '',
        children: [{ path: '/micro-son/device', routePath: '/micro-son/device' }]
      },
      {
        name: 'vue3子应用',
        serviceName: 'work-management',
        serviceEntry: '//localhost:12261',
        path: '',
        children: [
          { path: '/work-management/homePage', routePath: '/work-management/homePage' },
          { path: '/work-management/test', routePath: '/work-management/test' }
        ]
      }
    ]
  },
  mutations: {
    UPDATE_COUNT(state, active) {
      state.check = active
    },
    SET_QIANKUN_STATUS(state, active) {
      state.qiankunLoading = active
    }
  },
  actions: {
    toggleQianKunStatus({ commit }, status) {
      commit('SET_QIANKUN_STATUS', status)
    }
  }
})
export default store
